package cn.iune.erp.customer;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

//会员余额
@Entity
@Table(name="MemberBalance")
@NamedQuery(name="MemberBalance.findAll", query="SELECT s FROM MemberBalance s")
public class MemberBalance {

	@Id
	@Column(length=32)
	private String fID;
	
	@Column(length=32)
	private String systemCode;
	@Column(length=4)
	private String billType;
	@Column(length=20)
	private String billTypeName;
	private Date orderDate;
	@Column(length=10)
	private String state;
	@Column(length=10)
	private String status;
	
	@Column(length=4)
	private String origin;
	@Column(length=20)
	private String originName;
	@Column(length=20)
	private String originNo;
	
	//单号
	@Column(length=15)
	private String balanceNo;
	
	@Column(length=3)
	private String dealObject;
	@Column(length=20)
	private String dealObjectLabel;
	@Column(length=32)
	private String customerID;
	@Column(length=15)
	private String customerNo;
	@Column(length=20)
	private String shortName;
	@Column(length=128)
	private String customerName;
	
	//变动摘要
	@Column(length=256)
	private String remark;

	@Column(precision=38,scale=2,columnDefinition="DECIMAL(38,2) default 0",nullable=false)//会员积分
	private BigDecimal balance = BigDecimal.ZERO;

	//实际支付金额
	@Column(precision=38,scale=2,columnDefinition="DECIMAL(38,2) default 0",nullable=false)//会员积分
	private BigDecimal actualAmount = BigDecimal.ZERO;
	
	@Column(length=10)
	private String handling = "unpaid";//网上订单处理："unpaid"：待付款，"undelivery"：待发货，"receipted"：已接单，"unreceived"：待收货，"finished"：已完成，"cancelled"：已取消
	@Column(length=10)
	private String handlingLabel = "待付款";//网上订单处理

	
	@Column(length=256)
	private String comments;
	
	@Column(length=15)
	private String cUsercode;
	@Column(length=20)
	private String cUsername;//制单人
	private Timestamp cDatetime;
	@Column(length=15)
	private String eUsercode;
	@Column(length=20)
	private String eUsername;//关单人
	private Timestamp eDatetime;
	@Column(length=15)
	private String tUsercode;
	@Column(length=20)
	private String tUsername;//审核人
	private Timestamp tDatetime;
	
	@Column(length=65)
	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	@Column(length=128)
	private String enterpriseName;

	@Version
	private int version = 0;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}
	

	public String getfID() {
		return fID;
	}
	public void setfID(String fID) {
		this.fID = fID;
	}
	public String getSystemCode() {
		return systemCode;
	}
	public void setSystemCode(String systemCode) {
		this.systemCode = systemCode;
	}
	public String getBillType() {
		return billType;
	}
	public void setBillType(String billType) {
		this.billType = billType;
	}
	public String getBillTypeName() {
		return billTypeName;
	}
	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}
	public Date getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getcUsercode() {
		return cUsercode;
	}
	public void setcUsercode(String cUsercode) {
		this.cUsercode = cUsercode;
	}
	public String getcUsername() {
		return cUsername;
	}
	public void setcUsername(String cUsername) {
		this.cUsername = cUsername;
	}
	public Timestamp getcDatetime() {
		return cDatetime;
	}
	public void setcDatetime(Timestamp cDatetime) {
		this.cDatetime = cDatetime;
	}
	public String gettUsercode() {
		return tUsercode;
	}
	public void settUsercode(String tUsercode) {
		this.tUsercode = tUsercode;
	}
	public String gettUsername() {
		return tUsername;
	}
	public void settUsername(String tUsername) {
		this.tUsername = tUsername;
	}
	public Timestamp gettDatetime() {
		return tDatetime;
	}
	public void settDatetime(Timestamp tDatetime) {
		this.tDatetime = tDatetime;
	}
	public String geteUsercode() {
		return eUsercode;
	}
	public void seteUsercode(String eUsercode) {
		this.eUsercode = eUsercode;
	}
	public String geteUsername() {
		return eUsername;
	}
	public void seteUsername(String eUsername) {
		this.eUsername = eUsername;
	}
	public Timestamp geteDatetime() {
		return eDatetime;
	}
	public void seteDatetime(Timestamp eDatetime) {
		this.eDatetime = eDatetime;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getEnterpriseNo() {
		return enterpriseNo;
	}
	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}
	public String getEnterpriseName() {
		return enterpriseName;
	}
	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}
	public int getVersion() {
		return version;
	}
	public void setVersion(int version) {
		this.version = version;
	}
	public String getDealObject() {
		return dealObject;
	}
	public void setDealObject(String dealObject) {
		this.dealObject = dealObject;
	}
	public String getDealObjectLabel() {
		return dealObjectLabel;
	}
	public void setDealObjectLabel(String dealObjectLabel) {
		this.dealObjectLabel = dealObjectLabel;
	}
	public String getCustomerID() {
		return customerID;
	}
	public void setCustomerID(String customerID) {
		this.customerID = customerID;
	}
	public String getCustomerNo() {
		return customerNo;
	}
	public void setCustomerNo(String customerNo) {
		this.customerNo = customerNo;
	}
	public String getShortName() {
		return shortName;
	}
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	public String getCustomerName() {
		return customerName;
	}
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getBalanceNo() {
		return balanceNo;
	}
	public void setBalanceNo(String balanceNo) {
		this.balanceNo = balanceNo;
	}
	public BigDecimal getBalance() {
		return balance;
	}
	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}
	public String getHandling() {
		return handling;
	}
	public void setHandling(String handling) {
		this.handling = handling;
	}
	public String getHandlingLabel() {
		return handlingLabel;
	}
	public void setHandlingLabel(String handlingLabel) {
		this.handlingLabel = handlingLabel;
	}
	public String getOrigin() {
		return origin;
	}
	public void setOrigin(String origin) {
		this.origin = origin;
	}
	public String getOriginName() {
		return originName;
	}
	public void setOriginName(String originName) {
		this.originName = originName;
	}
	public String getOriginNo() {
		return originNo;
	}
	public void setOriginNo(String originNo) {
		this.originNo = originNo;
	}
	public BigDecimal getActualAmount() {
		return actualAmount;
	}
	public void setActualAmount(BigDecimal actualAmount) {
		this.actualAmount = actualAmount;
	}


}
